|
|
|
|
|
|
|
FIGRUE 19.2.
The sequence diagram showing the interactions between the objects in
the subsystem. |
|
|
|
|
|
|
|
|
The instance of IDSubsystem, theDBSubsystem, calls the setAdo method, passing the value eDataAccess.Ado. The method then creates instances of DBAdoConnection and DBAdoResultset. The instances are, at design time, each typed as Object. This late type binding (not using the New keyword with a specific class type) is necessary so that the generic DBConnection and DBResultset object properties of IDBSubsystem can be bound in memory to the mechanisms for Ado, Rdo, or Dao with minimal code changes. In creating each instance, the Class_Initialize event is triggered. The object, theDBSubsystem, then invokes the openConnection method of the instance of DBAdoConnection, passing in a connection string argument that contains enough information to open a data source. |
|
|
|
|
|
|
|
|
When the connection to the data source via Ado is successfully completed, Sub Main in modMain invokes the showForm method of theDatabaseForm form controller object. The controller object then invokes the setSQL method of the instance of CommandBroker, theCommandBroker, to set the string value of the current SQL statement to use. Again, the eDataAccess.Ado value is passed in so that the appropriate SQL command is used. Dao and Ado can use the same SQL syntax, particularly when it comes to columns with spaces in the name (such as [First Name]). This method assigns the requested SQL statement housed on CommandBroker to its property, CurrSQL. The property has the <Get>> stereotype, meaning that the type of property is a Get type (or stereotype in a strict sense) property. |
|
|
|
|
|
|
|
|
With the SQL statement set, theDatabaseForm invokes the openDBResultset method of DBResultset, which is a generic object property referencing DBAdoResultset. The first argument in the argument list is the SQL command statement, referenced by |
|
|
|
|
|